<template>
  <page-container :title="route.meta.title">
    <SearchTable :table-list-api="tableListApi" :columns="columns" :show-selection="true">
      <template #tableBtns>
        <a-button type="primary" @click="handleExport">导出数据</a-button>
      </template>
    </SearchTable>
  </page-container>
</template>

<script setup lang="ts">
import { useRoute } from 'vue-router';
import type { IColumn } from '@/types';
import SearchTable from '@/components/SearchTable';

const route = useRoute();
const tableListApi = '/v1/data/list';

const columns: IColumn[] = [
  {
    title: '序号',
    dataIndex: 'no',
  },
  {
    title: 'APP ID',
    dataIndex: 'description',
  },
  {
    title: '媒体',
    dataIndex: 'callNo',
    // customRender: (text: string) => text + ' 次',
  },
  {
    title: '广告位ID',
    dataIndex: 'status',
  },
  {
    title: '广告形式',
    dataIndex: 'updatedAt',
  },
  {
    title: '广告位名称',
    dataIndex: 'status',
  },
  {
    title: '接入方式',
    dataIndex: 'updatedAt',
  },
  {
    title: '广告位状态',
    dataIndex: 'status',
  },
  {
    title: '操作',
    dataIndex: 'updatedAt',
  },
];

const handleExport = () => {
  // TODO: 导出完善
  console.log('🚀 ~ handleExport ~ handleExport:');
};
</script>
